#!/bin/bash
cli=/Applications/wechatwebdevtools.app/Contents/Resources/app.nw/bin/cli
path=/Users/guobinfen/AndroidStudioProjects/mini_program_for_packaging/dev/bolome
VERSION=""
BRANCH=""
DESC=""
while getopts "V:D:B:" arg
do
        case ${arg} in
             V)
                VERSION=$OPTARG
                ;;
             B)
                BRANCH=$OPTARG
                ;;
             D)
                DESC=$OPTARG
                ;;
             ?)  #当有不认识的选项的时候arg为?
            echo "含有未知参数"
        exit 1
        ;;
        esac
done

echo ${BRANCH}
echo ${VERSION}
echo ${DESC}
cd ${path}
git pull
git checkout ${BRANCH}
git pull
#$cli -l
$cli -u ${VERSION}@${path} --upload-desc ${DESC}
